<?php
	namespace Home\Controller;
	use Think\Controller;
		
	class SetsubmitController extends Controller
	{
		public function index()
		{
			//用户名验证
			$userName=$_POST['userName'];
			$result=M('userinfo')->where("'{$userName}'=userName")->find();
			$u=$result["userId"];
			print_r($u);
			//查询问题提示列表
			$this->display();
		}
		public function index1()
		{
			$u=$_GET['u'];
<<<<<<< ccdd010c85bdd8b954e4ddaca55c646d03f4ffc0
			print_r($u);
=======
>>>>>>> 重新上传
			//查询问题提示列表
			$questionone=M('question')->select();
			$this->assign('u',$u);
			$this->assign('questionone',$questionone);
			$this->display();
		}
		public function index2()
		{
			$u=$_GET['u'];
<<<<<<< ccdd010c85bdd8b954e4ddaca55c646d03f4ffc0
			print_r($userId);
=======
>>>>>>> 重新上传
			//查询问题提示列表
			$this->assign('u',$u);
			$this->display();
		}
		public function yhm()
		{
			//用户名验证
			$userName=$_POST['userName'];
			$result=M('userinfo')->where("'{$userName}'=userName")->find();
			$u=$result["userId"];
			if($result != NULL)
			{
				$this->success("进行第二步验证！",__APP__."/Setsubmit/index1/u/$u");
			}
			else
			{
				$this->success("没有此用户！",__APP__."/Setsubmit/index");
			}
		}
		//密保验证
<<<<<<< ccdd010c85bdd8b954e4ddaca55c646d03f4ffc0
		public function mb($u)
		{
=======
		public function mb()
		{
			$u=$_GET['u'];
>>>>>>> 重新上传
			//用户名验证
			$questiontwo=$_POST['questiontwo'];
			$questionId=$_POST['questionId'];
			$result=M('userinfo')->where("'{$questiontwo}'=questiontwo and '{$questionId}'=questionId and '{$u}'=userId")->find();
			if($result != NULL)
			{
				$this->success("验证通过，请重置密码",__APP__."/Setsubmit/index2/u/$u");
			}
			else
			{
<<<<<<< ccdd010c85bdd8b954e4ddaca55c646d03f4ffc0
				$this->success("验证失败！",__APP__."/Setsubmit/index1");
			}
		}
		//重置密码
		public function mm($u)
=======
				$this->success("验证失败！",__APP__."/Setsubmit/index1/u/$u");
			}
		}
		//重置密码
		public function mm()
>>>>>>> 重新上传
		{
			$u=$_GET['u'];
			//用户名验证
			$password=$_POST['password'];
			$arr=array(password=>"$password");
			$result=M('userinfo')->where("'$u'=userId")->save($arr);
			if($result != NULL)
			{
				$this->success("密码修改成功",__APP__."/Login/index");
			}
			else
			{
<<<<<<< ccdd010c85bdd8b954e4ddaca55c646d03f4ffc0
				$this->success("验证失败！",__APP__."/Setsubmit/index2");
=======
				$this->success("验证失败,请重新输入！",__APP__."/Setsubmit/index2/u/$u");
>>>>>>> 重新上传
			}
		}
	}
	
?>